    /***
     * @description axios封装
     * @file api.ts
     * @author andy
     * @date 2024/3/22 16:40
     */
// file:api.s
// 1、导入axios以及拦截器
import service from './request'

// 删除商户
export const deleteUser = (userId:any) => {
    return service({
        url: '/user/index/deleteUser/' + userId,
        method: 'post'
    })
};



// 用户登录
export const adminLogin = (data:any) => {
    return service({
        url: '/user/index/adminLogin',
        method: 'post',
        data
    })
};

// 用户分页列表
export const getUserList = (data:any) => {
    return service({
        url: '/user/index/getUserList',
        method: 'post',
        data
    })
};

// 商户注册
export const userReg = (data:any) => {
    return service({
        url: '/user/index/userReg',
        method: 'post',
        data
    })
};

// 商户审核
export const checkUser = (data:any) => {
    return service({
        url: '/user/index/checkUser',
        method: 'post',
        data
    })
};

// 获取当前用户信息
export const getMyInfo = () => {
    return service({
        url: '/user/index/getMyInfo',
        method: 'post',
    })
};

// 修改商户信息
export const updateUser = (data:any) => {
    return service({
        url: '/user/index/updateUser',
        method: 'post',
        data
    })
};

// 批量删除用户
export const deleteUserAll = (data:any) => {
    return service({
        url: '/user/index/deleteUserAll',
        method: 'post',
        data
    })
};

// 分页获取商品列表
export const getProdList = (data:any) => {
    return service({
        url: '/prod/index/getProdList',
        method: 'post',
        data
    })
};

// 商品添加
export const addProd = (data:any) => {
    return service({
        url: '/prod/index/addProd',
        method: 'post',
        data
    })
};

// 获取字典列表
export const getDictList = (typeId:any) => {
    return service({
        url: '/prod/index/getDictList/' + typeId,
        method: 'post'
    })
};

// 删除商品
export const deleteProd = (prodId:any) => {
    return service({
        url: '/prod/index/deleteProd/' + prodId,
        method: 'post'
    })
};

// 商品修改
export const updateProd = (data:any) => {
    return service({
        url: '/prod/index/updateProd',
        method: 'post',
        data
    })
};

// 获取当前用户的角色列表
export const getMyRoleList = () => {
    return service({
        url: '/user/index/getMyRoleList',
        method: 'post',
    })
};

// 获取当前用户的菜单树
export const getUserMenuTree = () => {
    return service({
        url: '/user/index/getUserMenuTree',
        method: 'post',
    })
};

// 分页获取订单列表
export const getOrderList = (data:any) => {
    return service({
        url: '/order/index/getOrderList',
        method: 'post',
        data
    })
};


// 添加订单
export const addOrder = (data:any) => {
    return service({
        url: '/order/index/addOrder',
        method: 'post',
        data
    })
};

// 修改商品状态
export const changeProdStatus = (data:any) => {
    return service({
        url: '/prod/index/changeProdStatus',
        method: 'post',
        data
    })
};

// 商户分页列表（数据来源于ES）
export const getUserListFromEs = (data:any) => {
    return service({
        url: '/user/index/getUserListFromEs',
        method: 'post',
        data
    })
};

// 日志分页列表（数据来源于ES）
export const getLogList = (data:any) => {
    return service({
        url: '/user/log/getLogList',
        method: 'post',
        data
    })
};

// 发送手机验证码
export const sendCode = (data:any) => {
    return service({
        url: '/user/index/sendCode',
        method: 'post',
        data
    })
};

// 商户登录
export const shopperLogin = (data:any) => {
    return service({
        url: '/user/index/shopperLogin',
        method: 'post',
        data
    })
};

// 最近一个月，注册了多少人，其中男生和女生，各多少人
export const getRegInfo = () => {
    return service({
        url: '/user/index/getRegInfo',
        method: 'post',
    })
};

// 
export const getDayRegInfo = () => {
    return service({
        url: '/user/index/getDayRegInfo',
        method: 'post',
    })
};